home *** CD-ROM | disk | FTP | other *** search
/ SGI Performance Co-Pilot 1.3 / SGI Performance Co-Pilot 1.3.iso / dist / dist6.4 / pcp.idb / usr / share / catman / u_man / cat3 / PMAPI / pmdagetopt.z / pmdagetopt
Text File  |  1997-04-03  |  8KB  |  133 lines

  1.  
  2.  
  3.  
  4. PPPPMMMMDDDDAAAAGGGGEEEETTTTOOOOPPPPTTTT((((3333))))                                                    PPPPMMMMDDDDAAAAGGGGEEEETTTTOOOOPPPPTTTT((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt - get options from argument vector, trapping generic PMDA
  10.      options
  11.  
  12. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ppppccccpppp////ppppmmmmaaaappppiiii....hhhh>>>>
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ppppccccpppp////iiiimmmmppppllll....hhhh>>>>
  15.      ####iiiinnnncccclllluuuuddddeeee <<<<ppppccccpppp////ppppmmmmddddaaaa....hhhh>>>>
  16.  
  17.      iiiinnnntttt ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt((((iiiinnnntttt aaaarrrrggggcccc,,,, cccchhhhaaaarrrr ****ccccoooonnnnsssstttt ****aaaarrrrggggvvvv,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ooooppppttttssssttttrrrriiiinnnngggg,,,,
  18.      ppppmmmmddddaaaaIIIInnnntttteeeerrrrffffaaaacccceeee ****ddddiiiissssppppaaaattttcccchhhh,,,, iiiinnnntttt ****eeeerrrrrrrr))))
  19.  
  20.      cccccccc ............ ----llllppppccccpppp____ppppmmmmddddaaaa ----llllppppccccpppp
  21.  
  22. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  23.      This function is a wrapper for ggggeeeettttoooopppptttt(3).  The behavior of the function
  24.      is identical except that certain options are assumed to have a predefined
  25.      behavior which initializes several fields in the ppppmmmmddddaaaaIIIInnnntttteeeerrrrffffaaaacccceeee structure.
  26.  
  27.      The options that ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt will trap are:
  28.  
  29.      ----DDDD_t_r_a_c_e        Set the PPPPMMMMAAAAPPPPIIII(3) debug control variable (ppppmmmmDDDDeeeebbbbuuuugggg) to
  30.                     _t_r_a_c_e.  Used for controlling levels of trace output while
  31.                     debugging.
  32.  
  33.      ----dddd_d_o_m_a_i_n       Set the _d_o_m_a_i_n number of this agent.
  34.  
  35.      ----hhhh_h_e_l_p_f_i_l_e     Obtain the help text (see ppppmmmmddddaaaaTTTTeeeexxxxtttt(3)) for the metrics
  36.                     from this file rather than from the path specified with
  37.                     ppppmmmmddddaaaaDDDDSSSSOOOO(3) or ppppmmmmddddaaaaDDDDaaaaeeeemmmmoooonnnn(3).
  38.  
  39.      ----iiii_p_o_r_t         Expect PMCD to connect on inet _p_o_r_t (number or name).
  40.  
  41.      ----llll_l_o_g_f_i_l_e      Redirect diagnostics and trace output to _l_o_g_f_i_l_e.
  42.  
  43.      ----pppp             Expect PMCD to supply stdin/stdout pipe.
  44.  
  45.      ----uuuu_s_o_c_k_e_t       Expect PMCD to connect on unix domain _s_o_c_k_e_t.
  46.  
  47.      Only one of ----dddd, ----pppp and ----uuuu may be specified.  If none of these three
  48.      options is given, a pipe (----pppp) is assumed.  When these options are
  49.      encountered by ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt, the option is processed and the next option is
  50.      examined.  Therefore, ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt will only return when an option other
  51.      than those listed above is found, or the end of the list is reached.  The
  52.      returned value will be the argument or EOF, respectively.
  53.  
  54.      A PMDA can control which of these options the program will accept with
  55.      the _o_p_t_s_t_r_i_n_g argument.  To accept all the options, the PMDA should call
  56.      ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt with the option string "D:d:h:i:l:pu:".  Any PMDA specific
  57.      options should be added to this string in the style of ggggeeeettttoooopppptttt(3), and
  58.      returned by ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt if encountered.  However, the PMDA cannot reuse
  59.      any of the options specified above.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PPPPMMMMDDDDAAAAGGGGEEEETTTTOOOOPPPPTTTT((((3333))))                                                    PPPPMMMMDDDDAAAAGGGGEEEETTTTOOOOPPPPTTTT((((3333))))
  71.  
  72.  
  73.  
  74.      ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt takes a pointer to an int, _e_r_r, which is used as an error
  75.      count.  This variable should be initialized to zero before ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt is
  76.      first called, and tested when ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt returns EOF.
  77.  
  78.      ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt does not modify _a_r_g_c or _a_r_g_v.
  79.  
  80. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  81.      A PMDA which takes the additional argument ----nnnn and does not use ppppmmmmDDDDeeeebbbbuuuugggg
  82.      might call ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt like this:
  83.  
  84.               pmdaInterface dispatch;
  85.               int           err = 0;
  86.               int           c = 0;
  87.  
  88.               while ((c = pmdaGetOpt(argv, argc, "d:h:i:l:pu:n:",
  89.                                      dispatch &err)) != EOF) {
  90.                   /* process argument 'n', may use optarg etc. */
  91.               }
  92.  
  93.               if (err)
  94.                   usage(argv[0]);
  95.  
  96.      The global variables used by ggggeeeettttoooopppptttt ((((3333)))) may be used by the caller of
  97.      ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt within the argument parsing loop.
  98.  
  99. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  100.      ppppmmmmddddaaaaGGGGeeeettttOOOOpppptttt will display the same error messages as ggggeeeettttoooopppptttt.
  101.  
  102. CCCCAAAAVVVVEEEEAAAATTTT
  103.      The options ----DDDD, ----dddd, ----iiii, ----llll, ----pppp and ----uuuu cannot be reused for other purposes
  104.      by the PMDA.
  105.  
  106.      The PMDA must be using PPPPMMMMDDDDAAAA____PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL____2222 or later, as specified in the call
  107.      to ppppmmmmddddaaaaDDDDSSSSOOOO(3) or ppppmmmmddddaaaaDDDDaaaaeeeemmmmoooonnnn(3).
  108.  
  109. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  110.      ppppmmmmddddbbbbgggg(1), ggggeeeettttoooopppptttt(3), PPPPMMMMDDDDAAAA(3), ppppmmmmddddaaaaDDDDSSSSOOOO(3), ppppmmmmddddaaaaDDDDaaaaeeeemmmmoooonnnn(3) and ppppmmmmddddaaaaTTTTeeeexxxxtttt(3).
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.